package com.sright.bcard.enterprise.web.controller;

import com.sright.bcard.common.service.share.mvcresolver.EnableLoginAuth;
import com.sright.bcard.common.service.share.okhttp.domain.AuthDomain;
import com.sright.bcard.common.service.share.okhttp.domain.AuthFullParam;
import com.sright.bcard.common.share.service.AuthUploadService;
import com.sright.common.response.SrightResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/upload")
public class AuthUploadController {

    @Autowired
    private AuthUploadService authUploadService;

    @PostMapping("/auth.json")
    @EnableLoginAuth
    public SrightResponse test(@RequestBody AuthDomain authDomain) {
        AuthFullParam authFullParam = new AuthFullParam();
        authFullParam.setAuthDomain(authDomain);
        return authUploadService.auth(authFullParam);
    }

}
